package com.example.demo;

import org.springframework.web.multipart.commons.CommonsMultipartResolver;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by lei on 2017/5/20.
 */
public class MyCommonsMultipartResolver extends CommonsMultipartResolver {

	@Override
	public boolean isMultipart(HttpServletRequest request) {
		String uri = request.getRequestURI();
		System.out.println(uri);
		//过滤使用百度UEditor的URI
		if (uri.indexOf("ueditor") > 0) {     //此处拦截路径即为上面编写的controller路径
			System.out.println("commonsMultipartResolver 放行");
			return false;
		}
		System.out.println("commonsMultipartResolver 拦截");
		return super.isMultipart(request);
	}
}
